package com.wrupple.muba.catalogs.client.activity.process.task.impl;

import java.util.List;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.wrupple.muba.catalogs.client.activity.process.task.CatalogInteractionState;
import com.wrupple.muba.catalogs.client.view.EditView;
import com.wrupple.muba.common.shared.StateTransition;

public class SimpleCatalogInteractionState<T extends JavaScriptObject> implements CatalogInteractionState<T> {

	protected EditView<T> view;
	
	
	@Inject
	public SimpleCatalogInteractionState(EditView<T> view) {
		super();
		this.view = view;
	}

	@Override
	public void start(final T parameter, final StateTransition<T> onDone, final EventBus bus) {
		view.start(parameter, onDone, bus);
	}



	@Override
	public Widget asWidget() {
		return view.asWidget();
	}

	@Override
	public void setAction(List<? extends HasClickHandlers> actions) {
		view.setAction(actions);
	}

	@Override
	public EditView<T> getEditor() {
		return view;
	}

}
